if(wname=="baseball_gloves")
{
if(players[index].hands=="Hands in baseball gloves")
{
players[index].playsound("removegloves");
players[index].hands.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("weargloves");
players[index].hands="Hands in baseball gloves";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="winter_gloves")
{
if(players[index].hands=="Hands in winter gloves")
{
players[index].playsound("removegloves");
players[index].hands.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("weargloves");
players[index].hands="Hands in winter gloves";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="construction_gloves")
{
if(players[index].hands=="Hands in construction gloves")
{
players[index].playsound("removegloves");
players[index].hands.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("weargloves");
players[index].hands="Hands in construction gloves";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="clearing_gloves")
{
if(players[index].hands=="Hands in clearing gloves")
{
players[index].playsound("removegloves");
players[index].hands.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("weargloves");
players[index].hands="Hands in clearing gloves";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="boxing_gloves")
{
if(players[index].hands=="Hands in boxing gloves")
{
players[index].playsound("removegloves");
players[index].hands.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("weargloves");
players[index].hands="Hands, in boxing gloves";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="police_woman_pants")
{
if(players[index].legs=="legs, police woman pants")
{
players[index].playsound("removepants");
players[index].legs.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("wearpants");
players[index].legs="legs, police woman pants";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="police_man_pants")
{
if(players[index].legs=="legs, police man pants")
{
players[index].playsound("removepants");
players[index].legs.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("wearpants");
players[index].legs="legs, police man pants";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="police_woman_shirt")
{
if(players[index].interior=="police woman shirt on body")
{
players[index].playsound("removevest");
players[index].interior.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("wearvest");
players[index].interior="police woman shirt on body";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="police_man_shirt")
{
if(players[index].interior=="police man shirt on body")
{
players[index].playsound("removevest");
players[index].interior.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("wearvest");
players[index].interior="police man shirt on body";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="knit_hat")
{
if(players[index].head=="knitted hat on the head")
{
players[index].playsound("removehat");
players[index].head.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("wearhat");
players[index].head="knitted hat on the head";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="cowboy_hat")
{
if(players[index].head=="cowboy hat on the head")
{
players[index].playsound("removehat");
players[index].head.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("wearhat");
players[index].head="cowboy hat on the head";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
if(wname=="police_helmet")
{
if(players[index].head=="police helmet on the head")
{
players[index].playsound("removepolice_helmet");
players[index].head.resize(0);
send_reliable(players[index].peer_id,"you are not wearing"+wname+".",0);
return;
}
players[index].playsound("wearpolice_helmet");
players[index].head="police helmet on the head";
send_reliable(players[index].peer_id,"you are wearing"+wname+".",0);
}
